import java.beans.PropertyVetoException;


public class Test {
	public static void main(String[] args) {
		
		Academy a1 = new Academy("HamSko", "TralalVej");
		Person p1 = new Person(10, "esko", "Kesko", 5000);
		
		p1.addAgeErrorEventListener(a1);
//		p1.addAgeErrorEventListener(p1);
		p1.addVetoableChangeListener(p1);
		p1.addPropertyChangeListener(p1);
		
		System.out.println("" + p1.getName());
		
		
		p1.setAge(-1);
		
		try {
			p1.setCreditLimit(6000);
		} catch (PropertyVetoException e) {
			// TODO Auto-generated catch block
			System.out.println(e.getMessage());
			
			
		}
		
		System.out.println("" + p1.getCreditLimit());
		
		
		
		
		
	}
	
	

}
